package com.wjj.service;

import java.util.List;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import com.wjj.dao.GoodsDao;
import com.wjj.entity.Brand;
import com.wjj.entity.Goods;
import com.wjj.entity.Shopping;

@Service
public class GoodsServiceImpl implements GoodsService{
	@Autowired
	private GoodsDao goodsDao;
	//添加品牌
	@Override
	public void addBrand(Brand brand) {
		goodsDao.addBrand(brand);
	}
	//追加
	@Override
	public List<Brand> getBrand() {
		// TODO Auto-generated method stub
		return goodsDao.getBrand();
	}
	//添加商品
	@Override
	public void addGoods(Goods goods) {
		// TODO Auto-generated method stub
		goodsDao.addGoods(goods);
	}
	//购买商品
	@Override
	public List<Goods> selectGoods() {
		// TODO Auto-generated method stub
		return goodsDao.selectGoods();
	}
	//查询所有的品牌
//	@Override
//	public List<Brand> selectBrand() {
//		// TODO Auto-generated method stub
//		return goodsDao.selectBrand();
//	}
	//找到对应品牌下所有的商品
	@Override
	public List<Goods> listGoods(Integer id) {
		
		return goodsDao.listGoods(id);
	}
	//加入购物车
	@Override
	public int addShopping(Integer id) {
		// TODO Auto-generated method stub
		return goodsDao.addShopping(id);
	}
	//查看购物车
	@Override
	public List<Shopping> selectShopping() {
		// TODO Auto-generated method stub
		return goodsDao.selectShopping();
	}
	@Override
	public List<Shopping> selectshopping(Integer id) {
		// TODO Auto-generated method stub
		return goodsDao.selectShoppings(id);
	}
	//修改
	@Override
	public int setShopping(Integer id) {
		// TODO Auto-generated method stub
		return goodsDao.setShopping(id);
	}

}
